feat(attributes): Add browser.bfcache.* attributes - #513
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Attributes
Other
Internal Changes 🔧Attribute
Attributes
Deps
Other
🤖 This preview updates automatically when you update the PR. |
Registers the four attributes emitted by the new bfcacheMetricsIntegration in the JS SDK: browser.bfcache.outcome, browser.bfcache.reason, browser.bfcache.frame, and browser.bfcache.not_restored_reason_count. All are Sentry-specific (not in OTel).
The SDK frames reasons purely by position; 'masked' is a reason value, not a frame, so drop it (and 'unknown') from the frame attribute.
4074543 to
03cc94e
Compare
Lms24
left a comment
There was a problem hiding this comment.
The attribute names look very reasonable to me, so no objections to adding them from my end! We should adjust the apply_scrubbing behaviour though (see comment).
| "brief": "Which frame in the page's frame tree a back/forward cache not-restored reason originated from: the top document or a child frame.", | ||
| "type": "string", | ||
| "apply_scrubbing": { | ||
| "key": "never" |
There was a problem hiding this comment.
| "key": "never" | |
| "key": "manual" |
I 100% agree that Pii isnt a concern here but we should only set never if product functionality would break if the attribute value got scrubbed. Which I think isn't the case. It would break created BF-cache dashboards but users would have to do their part for this to happen. So I'd suggest we set "manual". Meaning if users configure this field to be scrubbed (for whatever reason) it will be scrubbed. Otherwise, it will be left as-is. More details: https://develop.sentry.dev/engineering-practices/sentry-conventions/#before-opening-a-pr
There was a problem hiding this comment.
Ah okay, thanks for the clarification!
Registers the four
browser.bfcache.*attributes emitted by the newbfcacheMetricsIntegrationin the JS SDK (getsentry/sentry-javascript#22397).They describe browser back/forward-cache health metrics.
browser.bfcache.outcomehit/missof a back/forward navigation.browser.bfcache.reasonnotRestoredReasons).browser.bfcache.frametop/child).browser.bfcache.not_restored_reason_count0when the browser reported none, e.g. non-Chromium).All are Sentry-specific, so
is_in_otel: falseand PII is not applicable here.